<template>
  <el-dialog :title="this.options.title" :visible.sync="this.options.isVisitable"
    :show-close="false"
    :width="options.width">
    <slot name="form"></slot>
    <div slot="footer" class="dialog-footer">
      <el-button @click="closeDialog">取 消</el-button>
      <el-button type="primary" @click="submit">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "Dialog",
  props: {
    options: {
      title: 'Dialog',
      isVisitable: false,
      width: '40%',
      type: null, // 操作类型（任意唯一值）：  用于submit的时候进行判断操作类型，从而执行对应的业务
    }
  },
  methods: {
    closeDialog() {
      this.$emit('close')
    },
    submit() {
      this.$emit('submit')
    }
  }
}
</script>

<style scoped>

</style>